import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Gao zhao xu
 * Date: 2023-11-18
 * Time: 9:32
 */
class  Person{
    public String id;

    public Person(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id='" + id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class Test {
    public static int func(String s, String p){
        String[] arr = s.split("");
        String[] arr1 = p.split("");
        int count = 0;
        for (String x : arr){
            for (String y : arr1){
                if (y .equals(x)){
                    count++;
                }
            }
        }
        return count;
    }
    public static void main(String[] args) {
        System.out.println(func("aA", "aAAbbbb"));
    }
    public static void main4(String[] args) {
        Person person1 = new Person("1234");
        Person person2 = new Person("1234");
        HashBuckGen<Person, String > hashBuckGen = new HashBuckGen<>();
        hashBuckGen.put(person1,"高朝旭");
        System.out.println(hashBuckGen.getVal(person2));
        hashBuckGen.put(person2,"梦泽旭" );
        System.out.println(hashBuckGen.getVal(person1));

    }
    public static void main3(String[] args) {
        HashBuckGen<Integer, Integer> hashBuckGen = new HashBuckGen<>();
        hashBuckGen.put(1,11);
        hashBuckGen.put(2,22);
        hashBuckGen.put(12,122);
        hashBuckGen.put(3,33);
        hashBuckGen.put(4,44);
        hashBuckGen.put(14,144);
        hashBuckGen.put(5,55);
        hashBuckGen.put(16,166);
        System.out.println("1.================================");
        System.out.println(hashBuckGen.getVal(5));
        System.out.println(hashBuckGen.getVal(16));
    }
    public static void main2(String[] args) {
        Person person1 = new Person("1234");
        Person person2 = new Person("1234");
        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());

    }
    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(1,11);
        hashBuck.put(2,22);
        hashBuck.put(12,122);
        hashBuck.put(3,33);
        hashBuck.put(4,44);
        hashBuck.put(14,144);
        hashBuck.put(5,55);
        hashBuck.put(16,166);
        System.out.println("1.================================");
        System.out.println(hashBuck.getVal(5));
        System.out.println(hashBuck.getVal(16));
    }
}
